﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using Pampa.WebControls;

namespace Pampa.MVC.Fluent.CustomControls
{
    public class ClientButtonBuilder : IHtmlString
    {
        private readonly ClientButton _clientButton;

        public ClientButtonBuilder()
        {
            _clientButton = new ClientButton();
            _clientButton.CssClass = "button";
        }

        public ClientButtonBuilder Text(string text)
        {
            _clientButton.Text = text;
            return this;
        }

        public ClientButtonBuilder Method(string method)
        {
            _clientButton.MethodName = method;
            return this;
        }

        public string ToHtmlString()
        {
            var sb = new StringBuilder();
            sb.Append(_clientButton.Render());

            return sb.ToString();
        }
    }
}
